//
// Created by Lemon on 2024/9/6.
//
#include "base_tracker.h"

std::string BaseTracker::staceSavePath = "";

void BaseTracker::setTrackStaceSavePath(std::string savePath) {
    staceSavePath = savePath;
}

BaseTracker::~BaseTracker() {
    staceSavePath.clear();
}

const char *BaseTracker::trackerArchSpecificFunction() {
    std::string architecture;
#if defined(__x86_64__) || defined(_M_X64)
    architecture = "x86_64";
#elif defined(__i386) || defined(_M_IX86)
    architecture = "x86";
#elif defined(__arm__) || defined(_M_ARM)
    architecture = "ARM";
#elif defined(__aarch64__)
    architecture = "ARM64";
#elif defined(__mips__)
    architecture = "MIPS";
#elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__)
    architecture = "PowerPC";
#else
    architecture = "Unknown";
#endif
    std::string system;
#ifdef _WIN32
    system = "run on window";

#elif __linux__
    system = "run on linux";
#elif __APPLE__
    system = "run on apple os";
#endif

    std::string whatGcc;
#ifdef __GNUC__
    whatGcc = "Compiled with GCC, version: " + std::to_string(__GNUC__) + "." +
              std::to_string(__GNUC_MINOR__);
#elif _MSC_VER
    whatGcc = "Compiled with MSVC, version: " + std::to_string(_MSC_VER);
#endif
    std::string total =
            "current architecture:" + architecture + ", system:" + system + ", gcc:" + whatGcc;
    return total.c_str();
}